1
|
|
package net.sf.flock.hibernate;
|
2
|
|
|
3
|
|
import java.net.URL;
|
4
|
|
import java.util.ArrayList;
|
5
|
|
import java.util.Date;
|
6
|
|
import java.util.List;
|
7
|
|
|
8
|
|
import net.sf.flock.FeedI;
|
9
|
|
import net.sf.flock.ItemI;
|
10
|
|
import net.sf.flock.SubscriptionInfoI;
|
11
|
|
|
12
|
|
class Feed implements FeedI {
|
13
|
|
|
14
|
|
private Subscription subscription;
|
15
|
|
|
16
|
|
private String title = "New feed";
|
17
|
|
private URL site;
|
18
|
|
private List items = new ArrayList();
|
19
|
|
|
20
|
|
/**
|
21
|
|
* @see net.sf.flock.FeedI#getItems()
|
22
|
|
*/
|
23
|
17
|
public List getItems() {
|
24
|
17
|
return this.items;
|
25
|
|
}
|
26
|
|
|
27
|
4
|
protected void setItems(List items) {
|
28
|
4
|
this.items = items;
|
29
|
|
}
|
30
|
|
|
31
|
|
/**
|
32
|
|
* @see net.sf.flock.FeedI#newItem(java.util.Date, java.lang.String, java.lang.String, java.net.URL)
|
33
|
|
*/
|
34
|
2
|
public ItemI newItem(Date creationTime, String title, String description, URL link) {
|
35
|
2
|
Item item = new Item();
|
36
|
2
|
item.setOrigin(this);
|
37
|
2
|
item.setCreationTime(creationTime);
|
38
|
2
|
item.setTitle(title);
|
39
|
2
|
item.setDescription(description);
|
40
|
2
|
item.setLink(link);
|
41
|
2
|
this.items.add( item );
|
42
|
2
|
return item;
|
43
|
|
}
|
44
|
|
|
45
|
|
/**
|
46
|
|
* @see net.sf.flock.FeedInfoI#getTitle()
|
47
|
|
*/
|
48
|
17
|
public String getTitle() {
|
49
|
17
|
return this.title;
|
50
|
|
}
|
51
|
|
|
52
|
|
/**
|
53
|
|
* @see net.sf.flock.FeedI#setTitle(java.lang.String)
|
54
|
|
*/
|
55
|
5
|
public void setTitle(String title) {
|
56
|
5
|
this.title = title;
|
57
|
|
}
|
58
|
|
|
59
|
|
/**
|
60
|
|
* @see net.sf.flock.FeedInfoI#getSite()
|
61
|
|
*/
|
62
|
17
|
public URL getSite() {
|
63
|
17
|
return this.site;
|
64
|
|
}
|
65
|
|
|
66
|
|
/**
|
67
|
|
* @see net.sf.flock.FeedI#setSite(java.net.URL)
|
68
|
|
*/
|
69
|
5
|
public void setSite(URL url) {
|
70
|
5
|
this.site = url;
|
71
|
|
}
|
72
|
|
|
73
|
|
/**
|
74
|
|
* @see net.sf.flock.FeedI#merge(net.sf.flock.FeedI)
|
75
|
|
*/
|
76
|
0
|
public List merge(FeedI feed) {
|
77
|
|
// TODO: implement merge
|
78
|
0
|
return null;
|
79
|
|
}
|
80
|
|
|
81
|
|
/**
|
82
|
|
* @see net.sf.flock.FeedInfoI#getSubscriptionInfo()
|
83
|
|
*/
|
84
|
0
|
public SubscriptionInfoI getSubscriptionInfo() {
|
85
|
0
|
return this.subscription;
|
86
|
|
}
|
87
|
|
|
88
|
0
|
public Subscription getSubscription() {
|
89
|
0
|
return subscription;
|
90
|
|
}
|
91
|
|
|
92
|
3
|
void setSubscription(Subscription subscription) {
|
93
|
3
|
this.subscription = subscription;
|
94
|
|
}
|
95
|
|
|
96
|
|
}
|
97
|
|
|